package com.liaogui.thread;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.CompletableFuture;

/**
 * @author liaogui
 * @date 2025/1/17 15:39
 */
@Slf4j
public class CompletableFutureDemo {
    public static void main(String[] args) {
        // 启动一个异步任务
        CompletableFuture<Void> task = CompletableFuture.runAsync(() -> {
            log.info("线程{}:", Thread.currentThread().getId());
        });
        // 等待异步人物完成
        task.join();
    }
}
